//
//  YQAssetsCell.m
//  NewRetail
//
//  Created by yuqin on 2019/6/23.
//  Copyright © 2019年 yuqin. All rights reserved.
//

#import "YQAssetsCell.h"

@implementation YQAssetsCell

- (void)setupTableViewCellView {
    self.layer.cornerRadius = 3;
    self.layer.masksToBounds = YES;
    
//    self.layer.shadowOffset = CGSizeMake(10, 10);
//    self.layer.shadowOpacity = 0.6;
//    self.layer.shadowColor = [UIColor redColor].CGColor;
    [self addSubview:self.backView];
    [self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(UIEdgeInsetsMake(0, 0, 0, 0));
    }];
    
    [self.backView addSubview:self.leftImg];
    [self.leftImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(FIT(16));
        make.centerY.mas_equalTo(self.backView.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(FIT(20), FIT(20)));
    }];
    
    [self.backView addSubview:self.coinTypeLab];
    [self.coinTypeLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.leftImg.mas_right).mas_equalTo(FIT(5));
        make.centerY.mas_equalTo(self.backView.mas_centerY);
    }];
    
    [self.backView addSubview:self.coinsLab];
    [self.coinsLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(FIT(-16));
        make.centerY.mas_equalTo(self.backView.mas_centerY);
    }];
}

- (UIView *)backView {
    if (!_backView) {
        _backView = [[UIView alloc] init];
        _backView.backgroundColor = WhiteColor;
//        _backView.layer.cornerRadius = 3;
//        _backView.layer.masksToBounds = NO;
        //        UIColorFromRGB(0xeeeee)
        [_backView LX_SetShadowPathWith:[UIColor redColor] shadowOpacity:0.5 shadowRadius:3 shadowSide:LXShadowPathBottom shadowPathWidth:10];
    }
    return _backView;
}

- (UIImageView *)leftImg {
    if (!_leftImg) {
        _leftImg = [YQViewFactory imageViewWithImage:YQ_IMAGE(@"")];
        _leftImg.backgroundColor = MainRedTextColor;
        _leftImg.layer.cornerRadius = FIT(10);
        _leftImg.layer.masksToBounds = YES;
    }
    return _leftImg;
}

- (UILabel *)coinTypeLab {
    if (!_coinTypeLab) {
        _coinTypeLab = [YQViewFactory labelWithTextColor:MainBlackColor textAlignment:NSTextAlignmentLeft fontSize:kCellFont userBold:NO];
        _coinTypeLab.text = @"WDC";
    }
    return _coinTypeLab;
}

- (UILabel *)coinsLab {
    if (!_coinsLab) {
        _coinsLab = [YQViewFactory labelWithTextColor:MainBlackColor textAlignment:NSTextAlignmentRight fontSize:kCellFont userBold:NO];
        _coinsLab.text = @"346.976755";
    }
    return _coinsLab;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
